/*
 * @Author: wuqingchun
 * @Date: 2024-04-22 19:06:48
 * @Description: 继承类实现
 * @LastEditors: wuqingchun
 * @LastEditTime: 2024-04-22 20:28:28
 */

#include <iostream>

#include "class_derived.h"

ClassDerivedPrivate::ClassDerivedPrivate()
{
    std::cout << "ClassDerivedPrivate::ClassDerivedPrivate()" << std::endl;
    std::cout << "    public: " << m_uiAtomicDerivedCount_public.load() << std::endl;
    std::cout << " protected: " << m_uiAtomicDerivedCount_protected.load() << std::endl;

    // error: ‘std::atomic<unsigned int> ClassBase::m_uiAtomicDerivedCount_private’ is private within this context
    // std::cout << "   private: " << m_uiAtomicDerivedCount_private.load() << std::endl;
}

ClassDerivedPrivate::~ClassDerivedPrivate()
{
    std::cout << "ClassDerivedPrivate::~ClassDerivedPrivate()" << std::endl;
}

void ClassDerivedPrivate::ShowInfo() const
{
    std::cout << "ClassDerivedPrivate::ShowInfo()" << std::endl;
}




ClassDerivedProtected::ClassDerivedProtected()
{
    std::cout << "ClassDerivedProtected::ClassDerivedProtected()" << std::endl;
    std::cout << "    public: " << m_uiAtomicDerivedCount_public.load() << std::endl;
    std::cout << " protected: " << m_uiAtomicDerivedCount_protected.load() << std::endl;

    // error: ‘std::atomic<unsigned int> ClassBase::m_uiAtomicDerivedCount_private’ is private within this context
    // std::cout << "   private: " << m_uiAtomicDerivedCount_private.load() << std::endl;
}

ClassDerivedProtected::~ClassDerivedProtected()
{
    std::cout << "ClassDerivedProtected::~ClassDerivedProtected()" << std::endl;
}

void ClassDerivedProtected::ShowInfo() const
{
    std::cout << "ClassDerivedProtected::ShowInfo()" << std::endl;
}


ClassDerivedPublic::ClassDerivedPublic()
{
    std::cout << "ClassDerivedPublic::ClassDerivedPublic()" << std::endl;
    std::cout << "    public: " << m_uiAtomicDerivedCount_public.load() << std::endl;
    std::cout << " protected: " << m_uiAtomicDerivedCount_protected.load() << std::endl;

    // error: ‘std::atomic<unsigned int> ClassBase::m_uiAtomicDerivedCount_private’ is private within this context
    // std::cout << "   private: " << m_uiAtomicDerivedCount_private.load() << std::endl;
}

ClassDerivedPublic::~ClassDerivedPublic()
{
    std::cout << "ClassDerivedPublic::~ClassDerivedPublic()" << std::endl;
}


void ClassDerivedPublic::ShowInfo() const
{
    std::cout << "ClassDerivedPublic::ShowInfo()" << std::endl;
}
